package com.common.tool;

import cn.hutool.core.util.StrUtil;

import java.util.List;
import java.util.stream.Stream;

public class StringTool {
    public static Long convertToListByOne(String coverIds){
        return convertIdsToList(coverIds).get(0);
    }

    public static List<Long> convertIdsToList(String ids){
        if (StrUtil.isEmptyIfStr(ids)){
            return null;
        }
        return Stream.of(ids.split(",")).map(Long::parseLong).toList();
    }
}
